// Copyright  2004-2008 Backplane Ltd.
//
// This file is part of Ubiquity formsPlayer
//
// Ubiquity formsPlayer is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3 of the License, or (at your
// option) any later version.
//
// Ubiquity formsPlayer is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License
// along with Ubiquity formsPlayer If not, see <http://www.gnu.org/licenses/>.
//	
//
//   Purpose: declaration of CImplActionMessage.
//   $Id$


#pragma once
#include "actions.h"

#include "ImplActionWithOnDemandBindings.h"
class CSingleNodeBindingOnDemand;
class CImplBind;

class CXFormsElementMessage;

class CImplActionMessage :
	public CImplActionWithOnDemandBindings
{
		friend class CXFormsParseMessage;
public:
	CImplActionMessage();
	CImplActionMessage(CXFormsElementMessage*);
	virtual ~CImplActionMessage();
	enum ELevels
	{
		NOTIMPL,
		modeless,
		modal,
		ephemeral
	};
	virtual ELevels getLevel();
	// Bug 987: Allow messages to target the system tray.
	inline void TargetSystray(bool bTargetSystray);
	
	virtual void ResolveBindings();
	bool m_bIsShowing;
protected:
		ELevels m_eLevel;
private:
		//Single Node Binding Attributes
	CComBSTR m_sRef;
	CComBSTR m_sBind;

	CImplBind * m_pBind;
	CSingleNodeBindingOnDemand * m_pRefEvaluator;

	// Bug 987: Allow messages to target the system tray.
	HRESULT SystrayInvoke(void);

	CComBSTR m_sTextContent;

	bool m_bTargetIsSystray;
	virtual HRESULT PerformAction();
	void GetTextValue(BSTR * psValue);
};

inline void CImplActionMessage::TargetSystray(bool bTargetSystray)
{
	m_bTargetIsSystray = bTargetSystray;
}